﻿using Idte.Common.Patterns;
using Idte.Core.Infrastructure.Repository;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Idte.Common.Process
{

    //[Aggregate]
    public abstract class StepDescriptor : IStepDescriptor, ICreator<Step>
    {
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public Guid Id { get; set; }
        public string Code { get; set; }
        public string Name { get; set; }
        public int? Sequence { get; set; }

        //[ForeignKey("ParentId")]
        //public TParent Parent { get; set; }
        //public Guid? ParentId { get; set; }

        public abstract Step Create();

        object ICreator.Create()
        {
            return Create();
        }
    }
    //public class StepDescriptor<TProcess> where TProcess : ProcessDescriptor<StepDescriptor<TProcess>> 
    //{
    //    public ICollection<TProcess> SubProcesses { get; set; }
    //}
}
